<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/gsap.min.js"></script>

    <script src="https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/ScrollTrigger.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/TextPlugin.min.js"></script>
    <style>
        * {
            padding: 0;
            margin: 0;
            box-sizing: border-box;
        }
        body {
            width: 100vw;
            overflow-x: hidden;
        }
        .box1 {
            height: 100vh;
            background-color: #eee;
            display: flex;
            align-items: center;
            justify-content: stretch;
        }
        .bg-lines__group {
            --box-color: #ddd;
            width: 100vw;
            height: 100vh;
            transform: translateX(0);
            background-image: 
                linear-gradient(to top right, 
                    transparent 50%, 
                    var(--box-color) 50%,
                    var(--box-color) 100%
                );
            background-position: top left;
        }
        .bg-lines__box {
            width: 100vw;
            height: 100vh;
            transform: translateX(100vw);
            background: var(--box-color);
        }
    </style>
</head>
<body>
    <div class="wrapper">
        <div class="box1"></div>
        <div class="bg-lines__group">
            <div class="bg-lines__box"></div>
        </div>
        <div class="box1"></div>
        
        
      </div>

    <!-- <button id="animate">animate</button> -->
    <script>
        // use a script tag or an external JS file
        document.addEventListener("DOMContentLoaded", (event) => {
            gsap.registerPlugin(ScrollTrigger,TextPlugin)
            let timeline1 = gsap.timeline({
                scrollTrigger: {
                    trigger: ".wrapper",
                    scrub: .5,
                    start: "10%",
                    end: "30%",
                    pin: false,
                    markers: true
                }
            })
            timeline1
                .to('.bg-lines__group', {x: '-100%'})
        });
       
       </script>
</body>
</html>